<?php
include("../../inc/conn.inc");
include("../islogin.php");
function jsURL($text,$url)
{
		header("Content-Type:text/html; charset=utf-8");
        echo '<script>alert("'.$text.'");location.href="'.$url.'"</script>';
        exit;
}
$id = intval($_GET['id']);
if(isset($_GET['status']))
{
	$status = $_GET['status'];
}

if(!($status ==='0' || $status === '1'))
{
	jsURL("操作失败","friend.php");
}

$sql = "update  member_link set `check`=1,status=$status  where id=$id ";
$re = mysql_query($sql);

	if($re)
	{
	jsURL("操作成功","friend.php");
	}
	else
	{
		jsURL("操作失败","friend.php");
	}

?>

